package com.yukefms.jointpoint.interfaces;

/**
 * @Description It is a calculator interface for computing various Euclid measurements, ie. angle, parallel etc.
 * Vector3D: angle(Vector3D)
 * angleEpsilon
 * rotationAngle
 *
 * EuclidGeometryTools.areLine3DsCollinear
 * EuclidGeometryTools.areVector3DsParallel
 * EuclidGeometryTools.intersectionBetweenTwoPlane3Ds
 * @Author Ping
 * @Date 2021/6/19 10:02
 **/
public interface BodyPointCalculator {
    /**
     * get the angle from two vectors by p2-p1, p3-p1.
     * @param p1
     * @param p2
     * @param p3
     * @return
     */
    double angle(Position origin, Position direct1, Position direct2) ;

    /**
     * the distance for two points
     * @param p1
     * @param p2
     * @return
     */
    double distanceOfTwoPositions(Position p1, Position p2) ;

    /**
     * get the distance from p1 to the line formed by p2 and p3
     * @param p1
     * @param p2
     * @param p3
     * @return
     */
    double distanceFromPositionToLine(Position p1, Position lineStart, Position lineEnd) ;

    /**
     * the distance from one position p1 to the plane formed by p2, p3, p4.
     * @param p1
     * @param p2
     * @param p3
     * @param p4
     * @return
     */
    double distanceFromPositionToPlane(Position p1, Position planePoint1, Position planePoint2, Position planePoint3) ;

    /**
     * decide if two lines formed by {@code p1,p2} and {@code p3,p4}, respectively, under tolerant threshold {@code epsilon}
     * @param p1
     * @param p2
     * @param p3
     * @param p4
     * @param epsilon
     * @return
     */
    boolean isTwoLineParallel(Position line1Start, Position line1End, Position line2Start, Position line2End, double angleEpsilon) ;



}
